package com.ljj.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import com.ljj.entity.Video;
import com.ljj.mapper.VideoMapper;
import com.ljj.service.IVideoService;
import com.ljj.utli.Result;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author liujiju
 * @since 2021-11-19
 */
@RestController
@RequestMapping("/video")
public class VideoController {
	
	@Autowired
	IVideoService ve;
	@Autowired
	VideoMapper m;
	
	/**
	 * 全查
	 * @param d
	 * @return
	 */
		@RequestMapping("/vList")
		public Object vList(Video e) {
			return ve.vList(e);
			
			
			
		}
		
		/**
		 * 添加
		 * @param c
		 * @return
		 */
		@RequestMapping("/vadd")
		public Object vadd(Video c) {
			if (m.insert(c) > 0) {
				return new Result(0, "添加成功");
			} else {
				return new Result(1, "添加失败");
			}
		}
	/**
	 * 修改
	 * @param 
	 * @return
	 */
		@RequestMapping("/vupdate")
		public Object vupdate(Video d) {
			if (m.updateById(d) >0) {
				return new Result(0, "修改成功");
			} else {
				return new Result(1, "修改失败");
			}

		}
		/**
		 * 删除
		 * @param 
		 * @return
		 */
			@RequestMapping("/vdetele")
			public Object vdetele(Video d) {
				if (m.deleteById(d) > 0) {
					return new Result(0, "删除成功");
				} else {
					return new Result(1, "删除失败");
				}

			}
		

}
